<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!--退单审核弹窗  -->

<div  class="content-warp">
    <div class="distribPersonel" id="transferOrderPageBox" style="padding: 20px 20px">
        <form action="" id="transferOrderBoxForm" >

            <table class="dggui-table-info">
                <tbody>
                <tr>
                    <th>所属订单:</th>
                    <td>${productOrder.scProductOrderNo}</td>
                </tr>
                <tr>
                    <th>客户名称:</th>
                    <td>${productOrder.customerName}</td>
                </tr>
                <tr>
                    <th>签单商务:</th>
                    <td>${productOrder.signUserName}</td>
                </tr>
                <tr>
                    <th>来源事业部:</th>
                    <td>${productOrder.flowUserOrgName}</td>
                </tr>
                <tr>
                    <th>签单产品:</th>
                    <td>${productOrder.productName}</td>
                </tr>
                <tr>
                    <th>当前生产阶段:</th>
                    <td>${productOrder.latestEndNodeName}</td>
                </tr>
                <tr>
                    <th>退单原因:</th>
                    <td>${productOrder.abandonReason}</td>
                </tr>
                <tr>
                    <th>退单备注:</th>
                    <td>${productOrder.remark}</td>
                </tr>
                <tr>
                    <th><span class="required">审核结果：</span></th>
                    <td>
                        <select class="dggui-select" id="auditResult" name="auditResult" onchange="isShow()">
                        <option value="" >请选择</option>
                        <option value="0">同意</option>
                        <option value="1">驳回</option>
                    </select>
                    </td>
                </tr>
                <c:if test="${productNodeFlow.examineGrade > (productOrder.abandonReasonNum+1)}">
                    <tr id="signinId">
                        <th><span class="required">下一审核人：</span></th>
                        <td>
                            <select class="dggui-select" id="nextAuditor" name="nextAuditor">
                            </select>
                        </td>
                    </tr>
                </c:if>
                <p id="examineGrade" name="examineGrade" data-examineGrade="${productNodeFlow.examineGrade > (productOrder.abandonReasonNum+1)}"  hidden></p>
                <%--<p id="abandonReasonNum" name="abandonReasonNum" data-abandonReasonNum="${productOrder.abandonReasonNum}"  hidden></p>--%>
                <tr>
                    <th ><span class="required">备注：</span></th>
                    <td>
                     <textarea placeholder="请填写备注,1-500字" class="dggui-textarea" id="remark" name="remark" maxlength="500"></textarea>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
    </div>
<script>
    $(function() {
       if(${productNodeFlow.examineGrade}>${productOrder.abandonReasonNum+1}) {
           dggui.use(['select2'],function () {
               var select2 = dggui.select2;
               //初始化流程人员
               initUser("RZSC_INCHARGE_USER", "department", "#nextAuditor");

               // initUserNoRemove("RZSC_DIRECTOR_USER","department", "#nextAuditor");
               select2.render({
                   placeholder: "请选择",
                   allowClear: true,
                   elem: $('#nextAuditor'),
                   width: "190px"
               });
           });
        }
    });

    function isShow() {
        var obj = document.getElementById("auditResult");
        var company = obj.options[obj.selectedIndex].value;
        company == 1 ? $('#signinId').hide() : $('#signinId').show();
    }

</script>
